<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="buscador.aspx.cs" Inherits="admin_buscador" %>

<asp:Content ID="Content1" ContentPlaceHolderID="contenido" Runat="Server">
    <form id="form1" runat="server">
    <table width="100%" align="center">
    <tr>
        <td>
            <img src="../admin/images/energy.jpg" / width="150">
        </td>
        <td align="center">
            <table>
            <tr>
                <td>Start Date:</td>
                <td>
                    <asp:TextBox ID="tb_startdate" runat="server"></asp:TextBox>
                </td>
                <td>End Date:</td>
                <td>
                    <asp:TextBox ID="tb_enddate" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>
                    &nbsp;</td>
                <td colspan="2" align="center">
                    <asp:Button ID="bt_search" runat="server" Text="Search" 
                        onclick="bt_search_Click" />
                </td>
            </tr>
            </table>
        </td>
        <td>
            <table>
            <tr>
                <th>SALES</th>
                <th>Single</th>
                <th>Double</th>
                <th>Total</th>
            </tr>
            <tr>
                <tH>Today</th>
                <td><asp:Label ID="lb_tosimple" runat="server" Text="0"></asp:Label></td>
                <td><asp:Label ID="lb_todouble" runat="server" Text="0"></asp:Label></td>
                <td><asp:Label ID="lb_tototal" runat="server" Text="0"></asp:Label></td>
            </tr>
            <tr>
                <th>Week</th>
                <td><asp:Label ID="lb_wesimple" runat="server" Text="0"></asp:Label></td>
                <td><asp:Label ID="lb_wedouble" runat="server" Text="0"></asp:Label></td>
                <td><asp:Label ID="lb_wetotal" runat="server" Text="0"></asp:Label></td>
            </tr>
            <tr>
                <th>Total</tH>
                <td><asp:Label ID="lb_simpletotal" runat="server" Text="0"></asp:Label></td>
                <td><asp:Label ID="lb_dobletotal" runat="server" Text="0"></asp:Label></td>
                <td><asp:Label ID="grantotal" runat="server" Text="0"></asp:Label></td>
            </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td align="center" colspan="3">
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Padron" 
                DataSourceID="PatriotaDataSource">
                <Columns>
                    <asp:CommandField ShowEditButton="True" />
                    <asp:BoundField DataField="Padron" HeaderText="Padron" ReadOnly="True" 
                        SortExpression="Padron" />
                    <asp:BoundField DataField="Nombre" HeaderText="Nombre" 
                        SortExpression="Nombre" />
                    <asp:BoundField DataField="Apellido" HeaderText="Apellido" 
                        SortExpression="Apellido" />
                    <asp:BoundField DataField="CedulaOrden" HeaderText="CedulaOrden" 
                        SortExpression="CedulaOrden" />
                    <asp:BoundField DataField="CedulaRegistro" HeaderText="CedulaRegistro" 
                        SortExpression="CedulaRegistro" />
                    <asp:BoundField DataField="Direccion" HeaderText="Direccion" 
                        SortExpression="Direccion" />
                    <asp:BoundField DataField="Celular" HeaderText="Celular" 
                        SortExpression="Celular" />
                    <asp:BoundField DataField="TelCasa" HeaderText="TelCasa" 
                        SortExpression="TelCasa" />
                    <asp:BoundField DataField="Municipio" HeaderText="Municipio" 
                        SortExpression="Municipio" />
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="PatriotaDataSource" runat="server" 
                ConflictDetection="CompareAllValues" 
                ConnectionString="<%$ ConnectionStrings:PacificStarBPOConnectionString %>" 
                DeleteCommand="DELETE FROM [tbl_patriota] WHERE [Padron] = @original_Padron AND [Nombre] = @original_Nombre AND [Apellido] = @original_Apellido AND (([CedulaOrden] = @original_CedulaOrden) OR ([CedulaOrden] IS NULL AND @original_CedulaOrden IS NULL)) AND [CedulaRegistro] = @original_CedulaRegistro AND [Direccion] = @original_Direccion AND (([Celular] = @original_Celular) OR ([Celular] IS NULL AND @original_Celular IS NULL)) AND (([TelCasa] = @original_TelCasa) OR ([TelCasa] IS NULL AND @original_TelCasa IS NULL)) AND [Municipio] = @original_Municipio" 
                InsertCommand="INSERT INTO [tbl_patriota] ([Padron], [Nombre], [Apellido], [CedulaOrden], [CedulaRegistro], [Direccion], [Celular], [TelCasa], [Municipio]) VALUES (@Padron, @Nombre, @Apellido, @CedulaOrden, @CedulaRegistro, @Direccion, @Celular, @TelCasa, @Municipio)" 
                OldValuesParameterFormatString="original_{0}" 
                SelectCommand="SELECT [Padron], [Nombre], [Apellido], [CedulaOrden], [CedulaRegistro], [Direccion], [Celular], [TelCasa], [Municipio] FROM [tbl_patriota]" 
                UpdateCommand="UPDATE [tbl_patriota] SET [Nombre] = @Nombre, [Apellido] = @Apellido, [CedulaOrden] = @CedulaOrden, [CedulaRegistro] = @CedulaRegistro, [Direccion] = @Direccion, [Celular] = @Celular, [TelCasa] = @TelCasa, [Municipio] = @Municipio WHERE [Padron] = @original_Padron AND [Nombre] = @original_Nombre AND [Apellido] = @original_Apellido AND (([CedulaOrden] = @original_CedulaOrden) OR ([CedulaOrden] IS NULL AND @original_CedulaOrden IS NULL)) AND [CedulaRegistro] = @original_CedulaRegistro AND [Direccion] = @original_Direccion AND (([Celular] = @original_Celular) OR ([Celular] IS NULL AND @original_Celular IS NULL)) AND (([TelCasa] = @original_TelCasa) OR ([TelCasa] IS NULL AND @original_TelCasa IS NULL)) AND [Municipio] = @original_Municipio">
                <DeleteParameters>
                    <asp:Parameter Name="original_Padron" Type="Int32" />
                    <asp:Parameter Name="original_Nombre" Type="String" />
                    <asp:Parameter Name="original_Apellido" Type="String" />
                    <asp:Parameter Name="original_CedulaOrden" Type="String" />
                    <asp:Parameter Name="original_CedulaRegistro" Type="String" />
                    <asp:Parameter Name="original_Direccion" Type="String" />
                    <asp:Parameter Name="original_Celular" Type="String" />
                    <asp:Parameter Name="original_TelCasa" Type="String" />
                    <asp:Parameter Name="original_Municipio" Type="String" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:Parameter Name="Padron" Type="Int32" />
                    <asp:Parameter Name="Nombre" Type="String" />
                    <asp:Parameter Name="Apellido" Type="String" />
                    <asp:Parameter Name="CedulaOrden" Type="String" />
                    <asp:Parameter Name="CedulaRegistro" Type="String" />
                    <asp:Parameter Name="Direccion" Type="String" />
                    <asp:Parameter Name="Celular" Type="String" />
                    <asp:Parameter Name="TelCasa" Type="String" />
                    <asp:Parameter Name="Municipio" Type="String" />
                </InsertParameters>
                <UpdateParameters>
                    <asp:Parameter Name="Nombre" Type="String" />
                    <asp:Parameter Name="Apellido" Type="String" />
                    <asp:Parameter Name="CedulaOrden" Type="String" />
                    <asp:Parameter Name="CedulaRegistro" Type="String" />
                    <asp:Parameter Name="Direccion" Type="String" />
                    <asp:Parameter Name="Celular" Type="String" />
                    <asp:Parameter Name="TelCasa" Type="String" />
                    <asp:Parameter Name="Municipio" Type="String" />
                    <asp:Parameter Name="original_Padron" Type="Int32" />
                    <asp:Parameter Name="original_Nombre" Type="String" />
                    <asp:Parameter Name="original_Apellido" Type="String" />
                    <asp:Parameter Name="original_CedulaOrden" Type="String" />
                    <asp:Parameter Name="original_CedulaRegistro" Type="String" />
                    <asp:Parameter Name="original_Direccion" Type="String" />
                    <asp:Parameter Name="original_Celular" Type="String" />
                    <asp:Parameter Name="original_TelCasa" Type="String" />
                    <asp:Parameter Name="original_Municipio" Type="String" />
                </UpdateParameters>
            </asp:SqlDataSource>
        </td>
    </tr>
    </table>
    </form>
</asp:Content>

